package net.hotelOrderSystem.controller;

import net.hotelOrderSystem.domain.Order;
import net.hotelOrderSystem.domain.OrderExample;
import net.hotelOrderSystem.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
@Controller
@RequestMapping("/HTML/*")
public class OrderController {
//
//    UserController userController = new UserController();
//    String curAccount = userController.getCurAccount() ;
//
//    @Autowired
//    private OrderService orderService;
//    @PostMapping("createOrder")
//    public String createOrder(){
//        System.out.println("！！！！");
//        return "/HTML/inputOrderInfo";
//    }
//
//    @PostMapping("createOrderTo")
//    public  String createOrderTo(Model model, @RequestParam("orderId")String orderId,
//                                @RequestParam("hotelName")String hotelName, @RequestParam("roomType")String roomType,
//                                @RequestParam("inNumber")Short inNumber, @RequestParam("inTime")String inTime,
//                                @RequestParam("outTime")String outTime, @RequestParam("orderStatus")Byte orderStatus,
//                                @RequestParam("paymentStatus")Byte paymentStatus, @RequestParam("roomNumber")String roomNumber) throws ParseException {
//        SimpleDateFormat inString=new SimpleDateFormat("yyyy-MM-dd");//小写的mm表示的是分钟
//        Date inDate=inString.parse(inTime);
//        SimpleDateFormat outString=new SimpleDateFormat("yyyy-MM-dd");//小写的mm表示的是分钟
//        Date outDate=outString.parse(outTime);
//
//        Order order = new Order(orderId,curAccount,hotelName,roomType,inNumber,inDate,outDate,orderStatus,paymentStatus,roomNumber);
//        model.addAttribute(order);
//        return "/HTML/orderList";
//    }
}
